<style>

    {if condition="$paotuiConfig['dispatch_mode'] eq 1"}
    .auto_dispatch_area{
        display: none;
    }
    {else:}
    .beat_area{
        display: none;
    }
    {/if}

</style>

<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <div class="panel-lead"><em>配置管理</em></div>
        <ul class="nav nav-tabs">
            <li class="active"><a href="#one" data-toggle="tab">配置中心</a></li>
        </ul>
    </div>

    <div class="panel-body">
        <div class="widget-body no-padding">
            <form id="one-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                <div class="form-group" style="display: none">
                    <label style="width: 230px;" class="control-label col-xs-12 col-sm-2">{:__('新订单（X）秒进入抢单广场')}：</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-new_post_second" data-rule="required" class="form-control" name="row[new_post_second]" type="text" value="{$paotuiConfig['new_post_second']}">
                    </div>
                </div>
                <div class="form-group">
                    <label style="width: 230px;" class="control-label col-xs-12 col-sm-2">{:__('人工派单(x)秒后算拒接')}：</label>
                    <div class="col-xs-12 col-sm-8">
                        <input id="c-hand_dispatch_delay" data-rule="required" class="form-control" name="row[hand_dispatch_delay]" type="text" value="{$paotuiConfig['hand_dispatch_delay']}">
                    </div>
                </div>
                <div class="form-group">
                    <label style="width: 230px;" class="control-label col-xs-12 col-sm-2">{:__('人工派单语音提醒')}：</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-hand_dispatch_mp3" data-rule="" class="form-control" size="50" name="row[hand_dispatch_mp3]" type="text" value="{$paotuiConfig['hand_dispatch_mp3']}">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-hand_dispatch_mp3" class="btn btn-danger faupload" data-input-id="c-hand_dispatch_mp3" data-mimetype="audio/mpeg" data-multiple="false" data-preview-id="p-hand_dispatch_mp3"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-hand_dispatch_mp3" class="btn btn-primary fachoose" data-input-id="c-hand_dispatch_mp3" data-mimetype="audio/mpeg" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-hand_dispatch_mp3"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-hand_dispatch_mp3"></ul>
                    </div>
                </div>
                <div class="form-group">
                    <label style="width: 230px;" class="control-label col-xs-12 col-sm-2">{:__('取消订单语音提醒')}：</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-cancel_mp3" data-rule="" class="form-control" size="50" name="row[cancel_mp3]" type="text" value="{$paotuiConfig['cancel_mp3']}">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-cancel_mp3" class="btn btn-danger faupload" data-input-id="c-cancel_mp3" data-mimetype="audio/mpeg" data-multiple="false" data-preview-id="p-cancel_mp3"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-cancel_mp3" class="btn btn-primary fachoose" data-input-id="c-cancel_mp3" data-mimetype="audio/mpeg" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-cancel_mp3"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-cancel_mp3"></ul>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2" style="width: 230px;">派单/抢单模式：</label>
                    <div class="col-xs-12 col-sm-8">
                        {:build_radios('row[dispatch_mode]', ['1'=>__('抢单'),'2'=>__('系统派单')],$paotuiConfig['dispatch_mode'])}
                    </div>
                </div>

                <div class="form-group beat_area">
                    <label style="width: 230px;" class="control-label col-xs-12 col-sm-2">{:__('抢单语音提醒')}：</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-beat_mp3" data-rule="" class="form-control" size="50" name="row[beat_mp3]" type="text" value="{$paotuiConfig['beat_mp3']}">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-beat_mp3" class="btn btn-danger faupload" data-input-id="c-beat_mp3" data-mimetype="audio/mpeg" data-multiple="false" data-preview-id="p-beat_mp3"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-beat_mp3" class="btn btn-primary fachoose" data-input-id="c-beat_mp3" data-mimetype="audio/mpeg" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-beat_mp3"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-beat_mp3"></ul>
                    </div>
                </div>

                <div class="form-group beat_area">
                    <label class="control-label col-xs-12 col-sm-2" style="width: 230px;">抢单推送设置：</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="form-group">
                            <div class="col-xs-12 col-sm-8">
                                <table class="table table-responsive fieldlist" data-index data-name="beat_config" data-template="beat_configtpl" data-tag="tr">
                                    <tr>
                                        <td style="width: 66px;">次数</td>
                                        <td style="width: 116px;">距离（Km）</td>
                                        <td style="width: 116px;">推送人数</td>
                                        <td style="width: 116px;">时间间隔（秒）</td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
                                    </tr>
                                    <textarea name="beat_config" class="form-control hide" cols="30" rows="5">{$beatSet}</textarea>
                                </table>
                                <!--定义模板-->
                                <script type="text/html" id="beat_configtpl">
                                    <tr class="form-inline">
                                        <td><input type="number" style="width: 50px;" readonly class="form-control row_<%=name%>_index" value="<%=row['index']%>"></td>
                                        <td><input type="number" style="width: 100px;" name="row[<%=name%>][<%=index%>][distance]" class="form-control" min="0" value="<%=row['distance']%>" size="10"></td>
                                        <td><input type="number" style="width: 100px;" name="row[<%=name%>][<%=index%>][num]" class="form-control" min="0" value="<%=row['num']%>" size="10"></td>
                                        <td><input type="number" style="width: 100px;" name="row[<%=name%>][<%=index%>][seconds]" class="form-control" min="0" value="<%=row['seconds']%>" size="10"></td>
                                        <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span></td>
                                    </tr>
                                </script>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group auto_dispatch_area">
                    <label style="width: 230px;" class="control-label col-xs-12 col-sm-2">{:__('系统派单语音提醒')}：</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group">
                            <input id="c-auto_dispatch_mp3" data-rule="" class="form-control" size="50" name="row[auto_dispatch_mp3]" type="text" value="{$paotuiConfig['auto_dispatch_mp3']}">
                            <div class="input-group-addon no-border no-padding">
                                <span><button type="button" id="faupload-auto_dispatch_mp3" class="btn btn-danger faupload" data-input-id="c-auto_dispatch_mp3" data-mimetype="audio/mpeg" data-multiple="false" data-preview-id="p-auto_dispatch_mp3"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                <span><button type="button" id="fachoose-auto_dispatch_mp3" class="btn btn-primary fachoose" data-input-id="c-auto_dispatch_mp3" data-mimetype="audio/mpeg" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                            </div>
                            <span class="msg-box n-right" for="c-auto_dispatch_mp3"></span>
                        </div>
                        <ul class="row list-inline faupload-preview" id="p-auto_dispatch_mp3"></ul>
                    </div>
                </div>

                <div class="form-group auto_dispatch_area">
                    <label class="control-label col-xs-12 col-sm-2" style="width: 230px;">系统派单推送设置：</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="form-group">
                            <div class="col-xs-12 col-sm-8">
                                <table class="table table-responsive fieldlist" data-index data-name="dispatch_config" data-template="dispatch_configtpl" data-tag="tr">
                                    <tr>
                                        <td style="width: 66px;">次数</td>
                                        <td style="width: 116px;">距离（Km）</td>
                                        <td style="width: 116px;">时间间隔（秒）</td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
                                    </tr>
                                    <textarea name="dispatch_config" class="form-control hide" cols="30" rows="5">{$dispatchSet}</textarea>
                                </table>
                                <!--定义模板-->
                                <script type="text/html" id="dispatch_configtpl">
                                    <tr class="form-inline">
                                        <td><input type="number" style="width: 50px;" readonly class="form-control row_<%=name%>_index" value="<%=row['index']%>"></td>
                                        <td><input type="number" style="width: 100px;" name="row[<%=name%>][<%=index%>][distance]" class="form-control" min="0" value="<%=row['distance']%>" size="10"></td>
                                        <td><input type="number" style="width: 100px;" name="row[<%=name%>][<%=index%>][seconds]" class="form-control" min="0" value="<%=row['seconds']%>" size="10"></td>
                                        <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span></td>
                                    </tr>
                                </script>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group layer-footer">
                    <label class="control-label col-xs-12 col-sm-2"></label>
                    <div class="col-xs-12 col-sm-8">
                        <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                        <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
